#include<bits/stdc++.h>
using namespace std;
#define int long long

int a[300005];

signed main()
{
	int n;
	cin>>n;
	for(int i = 1;i <= 3*n;i++)
		cin>>a[i];
	sort(a+1, a+3*n+1);
	
	int ans = 0;
	for(int i = 3*n-1;i >= n;i -= 2)
		ans += a[i];
	cout<<ans;
	return 0;
}

